package com.xywh.micro_warehousing.mvp.api;


import com.xywh.micro_warehousing.mvp.ui.entity.AddressAdd;
import com.xywh.micro_warehousing.mvp.ui.entity.AddressEdit;
import com.xywh.micro_warehousing.mvp.ui.entity.ChuRuKuJiLu;
import com.xywh.micro_warehousing.mvp.ui.entity.CounterSave;
import com.xywh.micro_warehousing.mvp.ui.entity.DownMapShow;
import com.xywh.micro_warehousing.mvp.ui.entity.ForgetPassword;
import com.xywh.micro_warehousing.mvp.ui.entity.GetDepart;
import com.xywh.micro_warehousing.mvp.ui.entity.GetFaultCode;
import com.xywh.micro_warehousing.mvp.ui.entity.GetIsExistsLoginName;
import com.xywh.micro_warehousing.mvp.ui.entity.GuiZiMap;
import com.xywh.micro_warehousing.mvp.ui.entity.Login;
import com.xywh.micro_warehousing.mvp.ui.entity.Material;
import com.xywh.micro_warehousing.mvp.ui.entity.ModifyPassword;
import com.xywh.micro_warehousing.mvp.ui.entity.ModifyPhone;
import com.xywh.micro_warehousing.mvp.ui.entity.ModifyPwd;
import com.xywh.micro_warehousing.mvp.ui.entity.OpenDoor;
import com.xywh.micro_warehousing.mvp.ui.entity.OpenLockAisle;
import com.xywh.micro_warehousing.mvp.ui.entity.PickingDetails;
import com.xywh.micro_warehousing.mvp.ui.entity.Register;
import com.xywh.micro_warehousing.mvp.ui.entity.ReturnDetails;
import com.xywh.micro_warehousing.mvp.ui.entity.SaoMiaoChaKanKuCun;
import com.xywh.micro_warehousing.mvp.ui.entity.Setting;
import com.xywh.micro_warehousing.mvp.ui.entity.ShenQingYuLiu;
import com.xywh.micro_warehousing.mvp.ui.entity.Tab1;
import com.xywh.micro_warehousing.mvp.ui.entity.Tab3;
import com.xywh.micro_warehousing.mvp.ui.entity.Tab4;
import com.xywh.micro_warehousing.mvp.ui.entity.Tab5;
import com.xywh.micro_warehousing.mvp.ui.entity.Tab6;
import com.xywh.micro_warehousing.mvp.ui.entity.UnlockedSuccessfully;
import com.xywh.micro_warehousing.mvp.ui.entity.YuLiuJiLuList;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;

public interface ApiService {

    /**
     * @param
     * @return
     * @method
     * @description 登录接口
     * @date: 2020/6/22 0022 14:24
     * @author: 小星
     */
    @GET("Account/get")
    Observable<Login> getLoginData(@QueryMap Map<String, String> map);

    @GET("Counter/GetFaultCode")
    Observable<List<GetFaultCode>> getFaultCode(@QueryMap Map<String, String> map);

    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("Counter/Save")
    Observable<CounterSave> counterSave(@Body RequestBody info);

    Observable<Tab4> getTab4Data(Map<String, String> map);

    Observable<AddressAdd> getAddressAddData(Map<String, String> map);

    Observable<AddressEdit> getAddressEditData(Map<String, String> map);

    /**
     * @param
     * @return
     * @method
     * @description 查询库存
     * @date: 2020/6/19 0019 14:02
     * @author: 小星
     */
    @GET("Inventory/QueryData")
    Observable<Tab1> getTab1Data(@QueryMap Map<String, String> map);

    @GET("Inventory/GetCounterMaterial")
    Observable<Material> getTab2Data(@QueryMap Map<String, String> map);

    /**
     * DoorCommand/OpenLock?spid=1
     * //http://192.168.8.100:8002/api/DoorCommand/OpenLock?spid=墨水瓶编码&uid=当前登录用户ID
     * 扫描柜子里的仓位，开门   预留开门
     *
     * @param map
     * @return
     */
    @GET("DoorCommand/OpenLock")
    Observable<OpenDoor> openDoor(@QueryMap Map<String, String> map);

    /**
     * @param
     * @return
     * @method
     * @description 扫码查看物料，开门
     * @date: 2020/7/2 0002 16:14
     * @author: 小星
     */
    @GET("DoorCommand/OpenLockAisle")
    Observable<OpenLockAisle> openLockAisle(@QueryMap Map<String, String> map);

    @GET("MaterialAPI/get/{spid}/")
    Observable<Material> getScanMaterialAPI(@Path("spid") String spid);

    @GET("Account/GetIsExistsLoginName")
    Observable<GetIsExistsLoginName> getIsExistsLoginName(@QueryMap Map<String, String> map);

    /**
     * 获取部门
     *
     * @param map
     * @return
     */
    @GET("Account/GetDepart")
    Observable<GetDepart> getDepart(@QueryMap Map<String, String> map);

    /**
     * @param
     * @return
     * @method
     * @description 出库记录查询
     * @date: 2020/6/22 0022 14:25
     * @author: 小星
     */
    @GET("Instore/get")
    Observable<List<Tab3>> getTab3Data(@QueryMap Map<String, String> map);

    Observable<ForgetPassword> getForgetPasswordData(Map<String, String> map);
    @FormUrlEncoded
    @POST("Account/Register")
    Observable<Register> getRegisterData(@FieldMap Map<String, String> map);

    /**
     * ?id=1892
     *
     * @param map
     * @return
     */
    @GET("Instore/GetReturn")
    Observable<ReturnDetails> getReturnDetailsData(@QueryMap Map<String, String> map);

    /**
     * ?id=1
     *
     * @param map
     * @return
     */
    @GET("Instore/GetUsed")
    Observable<PickingDetails> getPickingDetailsData(@QueryMap Map<String, String> map);

    Observable<Tab5> getTab5Data(Map<String, String> map);

    Observable<UnlockedSuccessfully> getUnlockedSuccessfullyData(Map<String, String> map);


    /**
     * @param map ?oldPassword=test1&newPassword=test1
     * @return
     */
    @GET("Account/ModifyPassword")
    Observable<ModifyPassword> modifyPassword(@QueryMap Map<String, String> map);

    /**
     * @param map ?phone=13805327777
     * @return
     */
    @GET("Account/ModifyPhone")
    Observable<ModifyPhone> modifyPhone(@QueryMap Map<String, String> map);

    @GET("Account/ModifyPassword")
    Observable<ModifyPwd> getModifyPwdData(@QueryMap Map<String, String> map);

    @GET("Instore/get")
    Observable<List<Tab6>> getTab6Data(@QueryMap Map<String, String> map);

    Observable<YuLiuJiLuList> getYuLiuJiLuListList(Map<String, String> map);

    Observable<ChuRuKuJiLu> getChuRuKuJiLuData(Map<String, String> map);

    Observable<Setting> getSettingData(Map<String, String> map);

    Observable<GuiZiMap> getGuiZiMapData(Map<String, String> map);

    Observable<DownMapShow> getDownMapShowData(Map<String, String> map);


    @GET("MaterialAPI/GetMaterialInfoFromEslNumber")
    Observable<SaoMiaoChaKanKuCun> getSaoMiaoChaKanKuCunData(@QueryMap Map<String, String> map);

    /**
     * @param
     * @return
     * @method
     * @description 申请预留物料
     * @date: 2020/6/22 0022 14:04
     * @author: 小星
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("Reserve/Add")
    Observable<ShenQingYuLiu> shenQingYuLiu(@Body RequestBody info);


}
